package com.ssm.opa.common.base.exception;


import com.ssm.opa.common.base.constants.ErrorCode;

/**
 * <p/>
 * Copyright: Copyright (c) 2016/12/6
 * <p/>
 * Company: 途牛科技有限公司华东分公司
 * <p/>
 *
 * @author wanghongqi@tuniu.com
 * @version 1.0.0
 * @project gtb-parent
 */
public class SysException extends TnException {

	public static final SysException JSON_PARSE_EXCEPTION = new SysException("Json parse exception", ErrorCode.JSON_PARSE_EXCEPTION);//json解析异常
	public static final SysException SQL_EXECUTE_ERROR = new SysException("Sql execute error", ErrorCode.SQL_EXECUTE_ERROR);//SQL执行错误
	public static final SysException UNMAPPED_TIME_PATTERN = new SysException("Unmapped time pattern", ErrorCode.UNMAPPED_TIME_PATTERN);//日期格式化错误
	public static final SysException HTTP_CLIENT_EXCEPTION = new SysException("Http client exception", ErrorCode.HTTP_CLIENT_EXCEPTION);//HTTP请求错误
	public static final SysException ACQUIRE_SERVER_IP_ERROR = new SysException("Acquire server ip error", ErrorCode.ACQUIRE_SERVER_IP_ERROR);//获取服务器IP地址失败
	public static final SysException SYSTEM_ERROR = new SysException("System error", ErrorCode.SYSTEM_ERROR);//未匹配错误的缺省错误
	public static final SysException SYSTEM_TOO_BUSY = new SysException("System too busy", ErrorCode.SYSTEM_TOO_BUSY);//服务器繁忙
	public static final SysException INTERNAL_ERROR_EXCEPTION = new SysException("Internal error exception", ErrorCode.INTERNAL_ERROR_EXCEPTION);//内部错误
	public static final SysException NO_PERMISSION = new SysException("No permission", ErrorCode.NO_PERMISSION);//限流


	public SysException(int errorCode) {
		super(errorCode);
	}

	public SysException(String message, int errorCode) {
		super(message, errorCode);
	}

	public SysException(String message, Throwable cause, int errorCode) {
		super(message, cause, errorCode);
	}

	public SysException(Throwable cause, int errorCode) {
		super(cause, errorCode);
	}

	public SysException(TnException tnException) {
		super(tnException);
	}

	public SysException(TnException tnException, String message) {
		super(tnException, message);
	}

	public SysException(TnException tnException, Throwable e) {
		super(tnException, e);
	}

	public SysException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, int errorCode) {
		super(message, cause, enableSuppression, writableStackTrace, errorCode);
	}
}
